home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume1 / sdi / patch1 < prev   
Encoding:
Internet Message Format  |  1991-01-03  |  11.0 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i096:  sdi - missle command game for Suns, Patch1
  5. Message-ID: <6730@tekred.CNA.TEK.COM>
  6. Date: 19 Dec 90 00:55:42 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 436
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Bill Randle <billr@saab.CNA.TEK.COM>
  12. Posting-number: Volume 11, Issue 96
  13. Archive-name: sdi/Patch1
  14. Patch-To: sdi: Volume 1, Issue 54-59
  15. Environment: SunView
  16.  
  17.     [This is a games that has been around for quite awhile.
  18.      I received a bugfix from Brian Nakata last spring for
  19.      the duplicate printing of text. I made some changes to
  20.      get it to compile and run on a SparcStation (SunOS 4.1).
  21.      It is still a great game!  -br]
  22.  
  23. #! /bin/sh
  24. # This is a shell archive.  Remove anything before this line, then unpack
  25. # it by saving it into a file and typing "sh file".  To overwrite existing
  26. # files, type "sh file -c".  You can also feed this as standard input via
  27. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  28. # will see the following message at the end:
  29. #        "End of shell archive."
  30. # Contents:  patches01
  31. # Wrapped by billr@saab on Tue Dec 18 16:50:39 1990
  32. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  33. if test -f 'patches01' -a "${1}" != "-c" ; then 
  34.   echo shar: Will not clobber existing file \"'patches01'\"
  35. else
  36. echo shar: Extracting \"'patches01'\" \(9196 characters\)
  37. sed "s/^X//" >'patches01' <<'END_OF_FILE'
  38. X*** control_procs.c.orig    Tue Dec 18 11:55:45 1990
  39. X--- control_procs.c    Tue Dec 18 16:30:09 1990
  40. X***************
  41. X*** 147,158 ****
  42. X   * Proc called to display the scores from the score file in a popup window.
  43. X   */
  44. X  void
  45. X! scores_proc(item, value, event)
  46. X  Panel_item item;
  47. X  Event *event;
  48. X  {
  49. X-     Menu m;
  50. X-     int id = event_id(event);
  51. X      char *a;
  52. X      a = (char *)build_scores();
  53. X      easy_pop(a);
  54. X--- 147,156 ----
  55. X   * Proc called to display the scores from the score file in a popup window.
  56. X   */
  57. X  void
  58. X! scores_proc(item, event)
  59. X  Panel_item item;
  60. X  Event *event;
  61. X  {
  62. X      char *a;
  63. X      a = (char *)build_scores();
  64. X      easy_pop(a);
  65. X*** helpers.c.orig    Tue Dec 18 11:55:36 1990
  66. X--- helpers.c    Tue Dec 18 12:02:30 1990
  67. X***************
  68. X*** 22,28 ****
  69. X  
  70. X  
  71. X  static short background_array[] = {
  72. X! #include "/usr/include/images/square_17.pr"
  73. X  };
  74. X  mpr_static(background_pr, 16, 16, 1, background_array);
  75. X  
  76. X--- 22,28 ----
  77. X  
  78. X  
  79. X  static short background_array[] = {
  80. X! #include <images/square_17.pr>
  81. X  };
  82. X  mpr_static(background_pr, 16, 16, 1, background_array);
  83. X  
  84. X***************
  85. X*** 141,147 ****
  86. X      }
  87. X      suspend_proc();
  88. X      init_popup_msg(frame, msg, lines);
  89. X-     textsw_insert(popup_text, msg, strlen(msg));
  90. X      window_set(popup_frame, WIN_X, event_x(event),
  91. X          WIN_Y, event_y(event),
  92. X          WIN_SHOW, TRUE,
  93. X--- 141,146 ----
  94. X*** makefile.orig    Tue Dec 18 16:36:49 1990
  95. X--- makefile    Tue Dec 18 16:38:17 1990
  96. X***************
  97. X*** 44,50 ****
  98. X  
  99. X  #If you are running SUNOS 3.0, use this: CFLAGS = -DSUNOS3_0
  100. X  
  101. X! CFLAGS = -DSUNOS3_0
  102. X  
  103. X  LIBS = -lsuntool -lsunwindow -lpixrect -lm
  104. X  
  105. X--- 44,50 ----
  106. X  
  107. X  #If you are running SUNOS 3.0, use this: CFLAGS = -DSUNOS3_0
  108. X  
  109. X! CFLAGS = 
  110. X  
  111. X  LIBS = -lsuntool -lsunwindow -lpixrect -lm
  112. X  
  113. X*** menu.c.orig    Tue Dec 18 11:55:58 1990
  114. X--- menu.c    Tue Dec 18 15:48:38 1990
  115. X***************
  116. X*** 1,5 ****
  117. X--- 1,6 ----
  118. X  #include <suntool/sunview.h>
  119. X  #include <stdio.h>
  120. X+ #include <varargs.h>
  121. X  #include "walkmenu_impl.h"
  122. X  #include "image_impl.h"
  123. X  
  124. X***************
  125. X*** 22,51 ****
  126. X   * Sun window library (at least a little bit).
  127. X   */
  128. X  
  129. X  
  130. X  void
  131. X! pie_menu_set(m, arg)
  132. X! struct menu *m;
  133. X! int arg;
  134. X  {
  135. X!     char **argptr = &(char *)arg;
  136. X      pie_menu_set_internal(m, argptr);
  137. X  }
  138. X  
  139. X! pie_menu_item_set(mi, arg)
  140. X! struct menu_item *mi;
  141. X! int arg;
  142. X  {
  143. X!     char **argptr = &(char *)arg;
  144. X      pie_menu_item_set_internal(mi, argptr);
  145. X  }
  146. X  
  147. X  struct menu *
  148. X! pie_menu_create(arg)
  149. X! int arg;
  150. X  {
  151. X!     char **argptr = &(char *)arg;
  152. X      struct menu *m;
  153. X      m = (struct menu *)calloc(sizeof(struct menu),1);
  154. X      m->item_list = (struct menu_item **)calloc(sizeof(struct menu_item *), MAX_ITEMS);
  155. X      m->max_nitems = MAX_ITEMS;
  156. X--- 23,62 ----
  157. X   * Sun window library (at least a little bit).
  158. X   */
  159. X  
  160. X+ /*
  161. X+  * re-written to use varargs so that it would run on a Sparc
  162. X+  *    Bill Randle    12/18/90
  163. X+  */
  164. X  
  165. X  void
  166. X! pie_menu_set(va_alist)
  167. X! va_dcl
  168. X  {
  169. X!     va_list argptr;
  170. X!     struct menu *m;
  171. X!     va_start(argptr);
  172. X!     m = va_arg(argptr, struct menu *);
  173. X      pie_menu_set_internal(m, argptr);
  174. X  }
  175. X  
  176. X! void
  177. X! pie_menu_item_set(va_alist)
  178. X! va_dcl
  179. X  {
  180. X!     va_list argptr;
  181. X!     struct menu_item *mi;
  182. X!     va_start(argptr);
  183. X!     mi = va_arg(argptr, struct menu_item *);
  184. X      pie_menu_item_set_internal(mi, argptr);
  185. X  }
  186. X  
  187. X  struct menu *
  188. X! pie_menu_create(va_alist)
  189. X! va_dcl
  190. X  {
  191. X!     va_list argptr;
  192. X      struct menu *m;
  193. X+     va_start(argptr);
  194. X      m = (struct menu *)calloc(sizeof(struct menu),1);
  195. X      m->item_list = (struct menu_item **)calloc(sizeof(struct menu_item *), MAX_ITEMS);
  196. X      m->max_nitems = MAX_ITEMS;
  197. X***************
  198. X*** 54,64 ****
  199. X  }
  200. X  
  201. X  struct menu_item *
  202. X! pie_menu_create_item(arg)
  203. X! int arg;
  204. X  {
  205. X!     char **argptr = &(char *)arg;
  206. X      struct menu_item *mi;
  207. X      mi = (struct menu_item *)calloc(sizeof(struct menu_item),1);
  208. X      mi->image = (struct image *)calloc(sizeof(struct image),1);
  209. X      pie_menu_item_set_internal(mi, argptr);
  210. X--- 65,76 ----
  211. X  }
  212. X  
  213. X  struct menu_item *
  214. X! pie_menu_create_item(va_alist)
  215. X! va_dcl
  216. X  {
  217. X!     va_list argptr;
  218. X      struct menu_item *mi;
  219. X+     va_start(argptr);
  220. X      mi = (struct menu_item *)calloc(sizeof(struct menu_item),1);
  221. X      mi->image = (struct image *)calloc(sizeof(struct image),1);
  222. X      pie_menu_item_set_internal(mi, argptr);
  223. X***************
  224. X*** 65,76 ****
  225. X      return mi;
  226. X  }
  227. X  
  228. X! pie_menu_set_internal(m, argptr)
  229. X  struct menu *m;
  230. X! char **argptr;
  231. X  {
  232. X!     while (*argptr != 0) {
  233. X!         switch(*argptr) {
  234. X              case MENU_APPEND_ITEM: {
  235. X                  if (m->nitems >= (m->max_nitems-1))
  236. X                      {
  237. X--- 77,90 ----
  238. X      return mi;
  239. X  }
  240. X  
  241. X! pie_menu_set_internal(m, ap)
  242. X  struct menu *m;
  243. X! va_list ap;
  244. X  {
  245. X!     Menu_attribute arg;
  246. X! 
  247. X!     while (arg = va_arg(ap, int)) {
  248. X!         switch(arg) {
  249. X              case MENU_APPEND_ITEM: {
  250. X                  if (m->nitems >= (m->max_nitems-1))
  251. X                      {
  252. X***************
  253. X*** 77,90 ****
  254. X                      fprintf("Too many items in a pie menu.\n");
  255. X                      abort();
  256. X                  }
  257. X!                 m->item_list[m->nitems] = (struct menu_item *)(*(argptr+1));
  258. X                  ((struct menu_item *)m->item_list[m->nitems])->parent = m;
  259. X                  m->nitems += 1;
  260. X!                 argptr += 2; break;
  261. X              }
  262. X              case MENU_NOTIFY_PROC: {
  263. X!                 (caddr_t)m->notify_proc = (caddr_t)(*(argptr+1));
  264. X!                 argptr += 2; break;
  265. X              }
  266. X              default: {
  267. X                  fprintf(stderr, "Unexpected item in pie_menu_set_internal.\n");
  268. X--- 91,104 ----
  269. X                      fprintf("Too many items in a pie menu.\n");
  270. X                      abort();
  271. X                  }
  272. X!                 m->item_list[m->nitems] = va_arg(ap, struct menu_item *);
  273. X                  ((struct menu_item *)m->item_list[m->nitems])->parent = m;
  274. X                  m->nitems += 1;
  275. X!                 break;
  276. X              }
  277. X              case MENU_NOTIFY_PROC: {
  278. X!                 (caddr_t)m->notify_proc = va_arg(ap, caddr_t);
  279. X!                 break;
  280. X              }
  281. X              default: {
  282. X                  fprintf(stderr, "Unexpected item in pie_menu_set_internal.\n");
  283. X***************
  284. X*** 93,131 ****
  285. X              }
  286. X          }
  287. X      }
  288. X  }
  289. X  
  290. X! pie_menu_item_set_internal(mi, argptr)
  291. X  struct menu_item *mi;
  292. X! char **argptr;
  293. X  {
  294. X!     while (*argptr != 0) {
  295. X!         switch(*argptr) {
  296. X              case MENU_IMAGE:  {
  297. X!                 mi->image->pr = (struct pixrect *)*(argptr+1);
  298. X!                 argptr += 2; break;
  299. X              }
  300. X              case MENU_STRING: {
  301. X!                 mi->image->string = (char *)*(argptr+1);
  302. X!                 argptr += 2; break;
  303. X              }
  304. X              case MENU_PULLRIGHT: {
  305. X                  mi->pullright = TRUE;
  306. X!                 mi->value = (caddr_t)*(argptr+1);
  307. X                  ((struct menu *)mi->value)->parent = mi;
  308. X!                 argptr += 2; break;
  309. X              }
  310. X              case MENU_RELEASE: {
  311. X                  mi->free_item = TRUE;
  312. X!                 argptr += 1; break;
  313. X              }
  314. X              case MENU_RELEASE_IMAGE: {
  315. X                  mi->image->free_image = TRUE;
  316. X!                 argptr += 1; break;
  317. X              }
  318. X              case MENU_CLIENT_DATA: {
  319. X!                 mi->client_data = (caddr_t)*(argptr+1);
  320. X!                 argptr += 2; break;
  321. X              }
  322. X              default: {
  323. X                  fprintf(stderr, "Unexpected item in pie_menu_item_set_internal.\n");
  324. X--- 107,148 ----
  325. X              }
  326. X          }
  327. X      }
  328. X+     va_end(ap);
  329. X  }
  330. X  
  331. X! pie_menu_item_set_internal(mi, ap)
  332. X  struct menu_item *mi;
  333. X! va_list ap;
  334. X  {
  335. X!     Menu_attribute arg;
  336. X! 
  337. X!     while (arg = va_arg(ap, int)) {
  338. X!         switch(arg) {
  339. X              case MENU_IMAGE:  {
  340. X!                 mi->image->pr = va_arg(ap, struct pixrect *);
  341. X!                 break;
  342. X              }
  343. X              case MENU_STRING: {
  344. X!                 mi->image->string = va_arg(ap, char *);
  345. X!                 break;
  346. X              }
  347. X              case MENU_PULLRIGHT: {
  348. X                  mi->pullright = TRUE;
  349. X!                 mi->value = va_arg(ap, caddr_t);
  350. X                  ((struct menu *)mi->value)->parent = mi;
  351. X!                 break;
  352. X              }
  353. X              case MENU_RELEASE: {
  354. X                  mi->free_item = TRUE;
  355. X!                 break;
  356. X              }
  357. X              case MENU_RELEASE_IMAGE: {
  358. X                  mi->image->free_image = TRUE;
  359. X!                 break;
  360. X              }
  361. X              case MENU_CLIENT_DATA: {
  362. X!                 mi->client_data = va_arg(ap, caddr_t);
  363. X!                 break;
  364. X              }
  365. X              default: {
  366. X                  fprintf(stderr, "Unexpected item in pie_menu_item_set_internal.\n");
  367. X***************
  368. X*** 134,139 ****
  369. X--- 151,157 ----
  370. X              }
  371. X          }
  372. X      }
  373. X+     va_end(ap);
  374. X  }
  375. X  
  376. X  pie_menu_destroy(m)
  377. X*** scores.c.orig    Tue Dec 18 11:55:49 1990
  378. X--- scores.c    Tue Dec 18 16:17:49 1990
  379. X***************
  380. X*** 104,110 ****
  381. X      FILE *f;
  382. X      if (scorefile) {
  383. X          tmpfile = scorefile;
  384. X!     } else if ((tmpfile = getenv("SDI_SCORES")) == NULL) {
  385. X              tmpfile = scorefile;
  386. X      } else {
  387. X          tmpfile = "/usr/games/lib/sdi_scores";
  388. X--- 104,110 ----
  389. X      FILE *f;
  390. X      if (scorefile) {
  391. X          tmpfile = scorefile;
  392. X!     } else if ((tmpfile = getenv("SDI_SCORES")) != NULL) {
  393. X              tmpfile = scorefile;
  394. X      } else {
  395. X          tmpfile = "/usr/games/lib/sdi_scores";
  396. X*** source_converter.c.orig    Tue Dec 18 11:56:34 1990
  397. X--- source_converter.c    Tue Dec 18 16:37:13 1990
  398. X***************
  399. X*** 27,33 ****
  400. X          fprintf(stderr, "Need an argument.\n");
  401. X          exit(1);
  402. X      }
  403. X!     printf(" .even\n__start_of_text:\n");
  404. X      while (! feof(stdin)) {
  405. X          p = buff;
  406. X          for (i = 0; i < OUTSIZE; i += 1) {
  407. X--- 27,33 ----
  408. X          fprintf(stderr, "Need an argument.\n");
  409. X          exit(1);
  410. X      }
  411. X!     printf(" .align 4\n__start_of_text:\n");
  412. X      while (! feof(stdin)) {
  413. X          p = buff;
  414. X          for (i = 0; i < OUTSIZE; i += 1) {
  415. X***************
  416. X*** 53,60 ****
  417. X          printf(" .ascii \"%s\"\n", buff);
  418. X      }
  419. X      printf(" .ascii \"\\0\"\n",'\\');
  420. X!     printf(" .even\n");
  421. X      printf(" .globl _%s\n", argv[1]);
  422. X      printf("_%s:\n", argv[1]);
  423. X      printf(" .long __start_of_text\n");
  424. X  }
  425. X--- 53,65 ----
  426. X          printf(" .ascii \"%s\"\n", buff);
  427. X      }
  428. X      printf(" .ascii \"\\0\"\n",'\\');
  429. X!     printf(" .align 4\n");
  430. X      printf(" .globl _%s\n", argv[1]);
  431. X      printf("_%s:\n", argv[1]);
  432. X+ #if defined(sparc)
  433. X+     printf(" .word __start_of_text\n");
  434. X+ #else
  435. X      printf(" .long __start_of_text\n");
  436. X+ #endif
  437. X+     exit(0);
  438. X  }
  439. END_OF_FILE
  440. if test 9196 -ne `wc -c <'patches01'`; then
  441.     echo shar: \"'patches01'\" unpacked with wrong size!
  442. fi
  443. # end of 'patches01'
  444. fi
  445. echo shar: End of shell archive.
  446. exit 0
  447.